//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月31日   下午1:52:41
 */
package edu.chinasoft.domain;

import java.util.List;

public class PageUnitForApplication {
	private List<Application> applicationList;
	private int pageUnit;
	private int pageNum;
	private int recordNum;
	private int currentPage;
	public List<Application> getApplicationList() {
		return applicationList;
	}
	public void setApplicationList(List<Application> applicationList) {
		this.applicationList = applicationList;
	}
	public int getPageUnit() {
		return pageUnit;
	}
	public void setPageUnit(int pageUnit) {
		this.pageUnit = pageUnit;
	}
	public int getPageNum() {
		int result=(recordNum-1)/pageUnit+1;
		return result;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
	public int getRecordNum() {
		return recordNum;
	}
	public void setRecordNum(int recordNum) {
		this.recordNum = recordNum;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getPrePage() {
		int result=this.currentPage-1;
		result=result<1?1:currentPage;
		return result;
	}
	public int getNextPage() {
		int result=this.currentPage+1;
		result=result>this.getPageNum()?this.pageNum:result;
		return result;
	}
	@Override
	public String toString() {
		return "PageUnitForApplication [applicationList=" + applicationList + ", pageUnit=" + pageUnit + ", pageNum="
				+ pageNum + ", recordNum=" + recordNum + ", currentPage=" + currentPage + "]";
	}
	
}
